<template>
  <div id="app">
    <div class="box" ref="box"></div>
    <!-- <button @class="getDOM">获取DOM</button> -->
    <input type="text" v-model="str">
    <h1>{{str | toUpper}}</h1>
  </div>
</template>

<script>
export default {
  data(){
    return {
      str:""
    }
  },
  filters:{
    toUpper(value){
      return value.toUpperCase()
    }
  },
  mounted(){
    let box = this.$refs.box;
    let w = window.getComputedStyle(box).width;
    console.log(w)
  },
  methods:{
    // getDOM(){
    //   // console.log(this.$refs.box)
    // }

  }
}
</script>

<style>
  .box{
    width: 200px;
    height: 200px;
    background-color: #f00;
  }
</style>
